package com.biwin.module.security.api.vo;

import com.biwin.module.org.api.vo.PositionVo;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.core.GrantedAuthority;

/**
 * TODO
 *
 * @author biwin
 * @since 0.0.1
 */
public class BaseRoleVo extends PositionVo implements GrantedAuthority, ConfigAttribute {
    public BaseRoleVo(PositionVo p) {
        super(p.getId(), p.getName(), p.getType(), p.getAdministrator(),
                p.getCreateTime(), p.getEnabled());
    }

    @Override
    public String getAttribute() {
        return "ROLE_" + this.getId().toString();
    }

    @Override
    public String getAuthority() {
        return "ROLE_" + this.getId().toString();
    }
}
